package com.common.utils;

import java.util.Random;

/**
 * @author yz
 * @data: 2022/4/7 13:11 星期四
 * @file : CodeUtil.java
 * 生成随机盐
 */
public class CodeUtil {

    private final static String STR = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz!@#$%^&*()";


    /**
     * 生成盐
     */
    public static String salt() {
        StringBuilder uuid = new StringBuilder();
        for (int i = 0; i < 10; i++) {
            char ch = STR.charAt(new Random().nextInt(STR.length()));
            uuid.append(ch);
        }
        return uuid.toString();

    }

}
